package com.kuiandjie.web;


import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kuiandjie.entity.Employee;
import com.kuiandjie.service.EmployeeService;

public class EmplistServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			EmployeeService es = new EmployeeService();
			List<Employee> emplist = es.findAll();
		
			request.setAttribute("emplist", emplist);
			request.getRequestDispatcher("/WEB-INF/views/emplist.jsp").forward(request, response);
		
	}

}
